<!--
 * @description 组件
 * @author: 陈陈
 * @date: 2025/05/09
 * @phone: 18560000860
 * @email: 18560000860@qq.com
 * @company: 济南晨霜信息技术有限公司 /
 * @business: 承接前后端项目的开发
-->
<template>
	<view
		class="pure-line"
		:class="_classes"
		:style="_styles"
	></view>
</template>

<script>
	import commonComponentOptions from "../../config/options";
	export default {
		options: commonComponentOptions
	};
</script>

<script setup>
	import { ref, computed } from "vue";
	import props from "./props";
	import { getThemeValue } from "../../utils";

	// -------------------------------------------------------------------------------- Refs
	const _props = defineProps(props);

	// -------------------------------------------------------------------------------- Emits
	const _emits = defineEmits([]);

	// -------------------------------------------------------------------------------- Classes
	const _classes = computed(() => {
		const array = [];

		// 纵向
		if (_props.vertical) array.push("pure-line--vertical");

		// 主题
		if (_props.theme) array.push(`pure-line--theme pure-line--theme-${_props.theme}`);

		return array;
	});

	// -------------------------------------------------------------------------------- Styles
	const _styles = computed(() => {
		const array = [];

		// 主题
		if (_props.theme) array.push(`--pure-line-theme: ${getThemeValue(_props.theme)}`);

		// 大小
		if (_props.size) {
			array.push(`--pure-line-size: ${_props.size}`);
		}

		// 颜色
		if (_props.color) {
			array.push(`--pure-line-color: ${_props.color}`);
		}

		// 宽度
		if (_props.width) {
			array.push(`--pure-line-width: ${_props.width}`);
		}

		// 高度
		if (_props.height) {
			array.push(`--pure-line-height: ${_props.height}`);
		}

		return array;
	});
</script>

<style scoped lang="scss">
	@import "./style.scss";
</style>
